#ifndef _ML_CONSOLE_MOVSTREAM_H_
#define _ML_CONSOLE_MOVSTREAM_H_
#include "MLCommon.h"

#include "MLMovStream.h"

#include "MLNumGen_Normal.h"
#include "MLNumGen_Uniform.h"

#include "MLTools_DistributionGenerator.h"
#include "MLTools_TxtFileLoader.h"
#include "MLTools_TxtFileSaver.h"

#include "MLDataSet.h"
#include "MLTools.h"
#include "MLTools_Stat.h"

#include <string>
#include <vector>

using namespace mylablib;

class CMLConsoleMovStream
{
public:
	CMLConsoleMovStream(void);
	~CMLConsoleMovStream(void);

public:
	// Methods
	int Run(const std::vector<std::wstring> &vCommand);
	int RunMovStream(void);

private:
	// Tools
	int InitMovStream(void);
	int InitStreamLoader(void);
	int InitOutputFile(void);
	int CloseAll(void);
	int OutputClusters(void);
	int OutputClusterEvents(const std::vector<CMLMovStreamClusterEvent>& vEvents);

private:
	// Fields
	std::wstring m_wstrInputFileName;
	std::wstring m_wstrOutputFileName;
	int m_nInitNumber;
	int m_nStreamBufferSize;
	int m_nStreamMaxLength;
	int m_nStatLength;
	int m_nHorizonLength;

	int m_nInitNumClusters;
	double m_dMaxRadius;
	double m_dMaxDriftFactor;
	double m_dStretchFactor;
	double m_dMaxAge;
	int    m_nNumLastTimeCheck;
	double m_dMergeFactor;
	double m_dMinDataPointNumberRatio;
	int m_nEventCheckInterval;

	bool   m_bDisplayClusterEvent;
	bool   m_bDisplayHorzionSSQ;
	bool   m_bDisplayRawFormat;
	bool   m_bDisplayOnlyTime;

	CMLMovStream m_MovStream;
	CMLTools_TxtFileLoader m_StreamLoader;
	std::wofstream m_OutputFile;
};


#endif
